/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package se.sll.service.catalogue.composite.camel.processor;

import java.util.ArrayList;
import java.util.List;
import org.apache.camel.Exchange;
import org.apache.camel.support.SynchronizationAdapter;
import se.sll.service.catalogue.common.rest.response.HsaData;

/**
 *
 * @author khaleddaham
 */
public class HsaCallback extends SynchronizationAdapter {

    private List<HsaData> data = new ArrayList<>();

    // this method is invoked when the exchange was a success and we can get the response
    @Override
    @SuppressWarnings("unchecked")
    public void onComplete(Exchange exchange) {
        data = (List<HsaData>) exchange.getOut().getBody(List.class);
    }

    public List<HsaData> getData() {
        return data;
    }

}
